package day05;

import java.util.ArrayList;
import java.util.Random;

public class homework_member {
    private int money;
    private String name;

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public homework_member() {
    }

    public homework_member(int money, String name) {
        this.money = money;
        this.name = name;
    }

    public void show(){
        System.out.println(this.getName()+"的钱为"+this.getMoney());
    }

    public void receivemoney(ArrayList<Integer> relist) {
        int index = new Random().nextInt(relist.size());
        Integer remoney = relist.remove(index);
        this.setMoney(remoney + this.getMoney());
    }
}
